package com.exchange.controller.app.playMent;

import com.exchange.controller.BaseController;
import com.exchange.interceptor.AppUserTokenInterceptor;
import com.jfinal.aop.Before;
import com.jfinal.aop.Inject;
import com.jfinal.kit.Ret;
import com.jfinal.upload.UploadFile;

/**
 * 支付方式
 */
@Before({PlayMentVaidator.class,AppUserTokenInterceptor.class})
public class PlayMentController extends BaseController{

	@Inject
	PlayMentService service;
	
    /**
     * 新增
     */
    public void add(UploadFile file, String payType, String payName, String account, String userName, String bankName) {   	
    	Ret ret = service.add(getAttr("user"), file, payType, payName, account, userName, bankName);
    	renderJson(ret);
    }

    /**
     * 删除支付方式
     */
    public void delete(Integer id){
    	Ret ret = service.delete(getAttr("user"), id);
    	renderJson(ret);
    }

    /**
     * 设为默认支付方式
     */
    public void priority(Integer id){
    	Ret ret = service.priority(getAttr("user"), id);
    	renderJson(ret);
    }

    /**
     * 获取当前用户的支付方式
     */
     public void list(){
    	 Ret ret = service.list(getAttr("user"));
 		 renderJson(ret);
     }

    /**
     * 获取当前用户支持的支付方式
     */
    public void type(){
    	Ret ret = service.type(getAttr("user"));
		renderJson(ret);
    }
	
	
}
